<template>
    <el-pagination v-model:current-page="pageInfo.page" v-model:page-size="pageInfo.size" :total="total"
        :layout="layout">
    </el-pagination>
</template>

<script setup lang="js">
const emits = defineEmits(["update:pageInfo"]);

const props = defineProps({
    // 当前页、页码
    pageInfo: {
        type: Object,
        default: () => ({
            page: 1,
            size: 10
        })
    },
    // 总数
    total: {
        type: Number,
        default: 0
    },
    // 分页器操作按钮配置
    layout: {
        type: String,
        default: "total, sizes, prev, pager, next, jumper"
    }
})

// 当前页 change事件
const pageChange = (page) => {
    emits("update:pageInfo", { ...props.pageInfo, page });
}

// 页码 change事件
const sizeChange = (size) => {
    emits("update:pageInfo", { ...props.pageInfo, size });
}
</script>
<style scoped lang="scss"></style>